/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************/
#include "forinstruction.h"

ForInstruction::ForInstruction()
{
    forCompleteFlag = false;
}

QDataStream& operator <<(QDataStream &out,ForInstruction &myVector)
{
    out << (quint32)myVector.actionType << myVector.firstFlag << myVector.forFlag <<
           (quint32)myVector.initialType << myVector.initialValue << myVector.registerNum<<
           (quint32)myVector.targetType << myVector.targetValue;

    return out;
}

QDataStream& operator >>(QDataStream &in,ForInstruction &myVector)
{
    quint32 actionType;
    quint32 initialType;
    quint32 targetType;

    in >> actionType >> myVector.firstFlag >> myVector.forFlag >>
          initialType >> myVector.initialValue >> myVector.registerNum>>
          targetType >> myVector.targetValue;

    myVector.actionType = (FOR_ACTION_TYPE)actionType;
    myVector.initialType = (FOR_INITITAL_VALUE)initialType;
    myVector.targetType = (FOR_TARGET_VALUE)targetType;

    return in;
}
